<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/pages/plantilla/css.jsp"></jsp:include>
<jsp:include page="/pages/plantilla/js.jsp"></jsp:include>
<html>
<script type="text/javascript">
	function regresar(){
		$.post("<%= request.getContextPath() %>/SRegistrarEvaluacion?accion=verEvaluacion&id=${objEmbarque.id}",
			function( data ){
				$("#div_xd").html(data);
			}
		);
	}
	function verCarateristicas(parametro){
		$.post("<%= request.getContextPath() %>/SRegistrarEvaluacion?accion=verCaracterisica&idDetalle="+parametro,
				function( data ){
					$("#div_xd").html(data);
				}
			);
	}
</script>
<form id="frm_busqueda" action="<%= request.getContextPath() %>/SRegistrarEvaluacion">
<table width="100%" style="margin-top: 35px;font-family:Segoe UI;background: #F5F3E5 ;font-size:11px;color:#666666;">
	<tr>
		<td valign="top" align="center">
			<input type="hidden" id="accion" name="accion" value="buscar">
			<table>
				<tr>
					<td>Tender</td>
					<td align="left">&nbsp; <input id="codigoTender" name="codigoTender" type="text" disabled="disabled" value="${objEmbarque.tenderDescrip}"></td>
				</tr>
				<tr>
					<td>Embarque</td>
					<td align="left">&nbsp; <input id="embarque" name="embarque" type="text" disabled="disabled" value="${objEmbarque.descripcion}"></td>
				</tr>
				<tr>
					<td>Brand</td>
					<td align="left">&nbsp; <input id="brand" name="brand" type="text" disabled="disabled" value="${objDetalleEmbarque.brand}"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table width="90%" style="margin-top: 35px;font-family:Segoe UI;background: #FFFFFF ;font-size:11px;color:#666666;">
	<tr>
		<td width="70%" valign="top">
			<table width="100%" border="0" cellspacing="0" style="border: 1px solid #CCCCCC;">
				<c:set var="para" value=""></c:set>
				<c:forEach var="det" items="${objDetalleEmbarque.parametros}">
					<c:if test="${det.id_parametro ne para}">
						<c:set var="para" value="${det.id_parametro}"></c:set>
						<tr class="tbl_Manto_cabecera_pie">
							<td height="25" align="left">&nbsp; Parametro</td>
							<td></td>
						</tr>
						<tr>
							<td height="25" align="left">&nbsp; ${det.parametro}</td>
							<td><a href="#" style="color:#0986DC;" onclick="verCarateristicas('${det.parametro}');">Detalle</a></td>
						</tr>
						<tr>
							<td colspan="2">
								<table width="100%" border="0" cellspacing="0" style="border: 1px solid #CCCCCC;">
									<tr class="tbl_Manto_cabecera_pie">
										<td height="25">Participante</td>
										<td>Cantidad</td>
										
									</tr>
									<c:forEach var="par" items="${objDetalleEmbarque.parametros}">
										<c:if test="${par.id_parametro eq det.id_parametro}">
											<c:if test="${par.id_detalle_parametro eq det.id_detalle_parametro}">
												<tr>
													<td height="25">${par.participante}</td>
													<td>${par.cantidad}</td>
												</tr>
											</c:if>
										</c:if>
									</c:forEach>
								</table>
							</td>
						</tr>
					</c:if>
				</c:forEach>
				
				<tr class="tbl_Manto_cabecera_pie">
					<td height="25" align="left">&nbsp; Totales</td>
					<td></td>
				</tr>
				<tr>
					<td colspan="2">
						<table width="100%" border="0" cellspacing="0" style="border: 1px solid #CCCCCC;">
							<tr class="tbl_Manto_cabecera_pie">
								<td height="25">Participante</td>
								<td>Cantidad</td>
								
							</tr>
							
							<c:forEach var="par" items="${objEmbarque.participantes}">
								<c:set var="cant" value="0"></c:set>
								<c:forEach var="det" items="${objDetalleEmbarque.parametros}">
									<c:if test="${par.id_participante eq det.id_participante}">
										<c:set var="cant" value="${cant + det.cantidad}"></c:set>
									</c:if>
								</c:forEach>
								<tr>
									<td height="25">${par.participante}</td>
									<td>${cant}</td>
								</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2">	
						<input type="button" value="Regresar" onclick="regresar()">
					</td>
				</tr>
			</table><br>
		</td>
	</tr>
</table>
</form>
</html>